/* 前缀和与差分
* 
* 本题:
    差分序列
    b1=a1; b2=a2-a1; b3=a3-a2;...bn=an-a[n-1]
    b[l]+=1; b[R+1]-=1;
    b[l]-=1; b[R+1]+=1;

    目标:
        1.至少操作多少次，可使b2~bn都为0
        2.b1有多少种值
    
    -> 整数和负数配对，正数-1，负数+1
    min(pos, neg) + abs(pos - neg) = max(pos, neg)
*/

#define DEBUG
#pragma GCC optimize("O1,O2,O3,Ofast")
#pragma GCC optimize("no-stack-protector,unroll-loops,fast-math,inline")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,sse4,sse4.1,sse4.2,ssse3")

#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define int long long
const int N = 1e5+10;

int s[N];
int pos, neg;

signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
    #else
        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #endif
    
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i)
        cin >> s[i]; 


    for(int i = n; i > 1; --i)
        s[i] -= s[i-1];
    

    for(int i = 2; i <= n; ++i){
        if(s[i] > 0) pos += s[i];
        else neg -= s[i];
    }
    
    cout << max(pos, neg) << endl;
    cout << abs(pos-neg) + 1 << endl;
    return 0;
}